package com.demo.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.demo.core.exception.ParameterException;
import com.demo.domain.RegistrationInformation;
import com.demo.domain.TeamProfile;
import com.demo.domain.ro.AddRegInfoRequest;
import com.demo.domain.vo.RegistrationDisplayListView;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;
import java.util.List;

@Transactional
public interface RegistrationInformationService extends IService<RegistrationInformation> {
    RegistrationInformation getByRiId(Long riId) throws ParameterException;

    Integer insertRegistrationInformation(RegistrationInformation registrationInformation) throws ParameterException;

    Integer updateRegistrationInformation(RegistrationInformation registrationInformation) throws ParameterException;

    Integer deleteRegistrationInformationById(RegistrationInformation registrationInformation) throws ParameterException;

    List<RegistrationInformation> selectRegistrationInformationList(RegistrationInformation registrationInformation) throws ParameterException;

    List<RegistrationInformation> listAllRegistrationInformation();

    //    得到某个申请的详细信息
    RegistrationInformation getOneRegistration(Long riId, Long uid) throws Exception, ParameterException;

    //    得到某人发出的所有队伍申请
    Page<RegistrationDisplayListView> getDisplayRegistrations(int current, int size, Long uid) throws Exception, ParameterException;

    //    某个队伍的所有入队申请
    List<RegistrationInformation> getRegistration(RegistrationInformation registrationInformation) throws ParameterException;

    //    通过申请入队
    boolean passRegistration(Long id, Long uid) throws IOException;

    //    拒绝申请入队
    boolean failRegistration(Long id, Long uid) throws IOException;

    //    提交报名信息
    AddRegInfoRequest addRegInf(AddRegInfoRequest addRegInfoRequest, Long uid) throws ParameterException, Exception;

    //    修改申请信息
    String modifyRegisterInfo(RegistrationInformation registrationInformation,Long uid) throws ParameterException, Exception;

    //    取消申请
    String cancelRegistration(Long riId,Long uid) throws ParameterException, Exception;

    //是否有未查看的申请审核信息
    Boolean hasNotViewedRegistrations(Long uid) throws ParameterException, Exception;

    //更改用户的申请信息都为已查看的状态
    Integer updateViewedRegistrations(Long uid) throws ParameterException, Exception;
}
